var vObj = new Vue({
	el: '#resultList',
	data: {
		search: {
			orgCode:'',
			startDate:getYear("s", 0)+' 00:00:00',//获取今年的第一天时间
			endDate:getYear("e", 0)+' 23:59:59'//获取今年的最后一天时间
		},
		orgOptions:[
            {text: '深圳海事局',value: '14'},
            {text: '蛇口海事局',value: '1402'},
            {text: '南上海事局',value: '1405'},
            {text: '宝安海事局',value: '1404'},
            {text: '盐田海事局',value: '1403'},
            {text: '大铲海事局',value: '1406'},
            {text: '大亚湾海事局',value: '1401'}
        ],
		dataList: []
	},
	watch: {},
	created: function() {
		//初始化数据
	    this.$nextTick(function() {
	    	vObj.getStatistics();
	    })
	},
	methods: {
	    info:function(){
	    	
		},
		//查询
		onClickSelect:function(){
			vObj.getTime();
		},
		//获取时间
		getTime:function(){
			var inputVlue = $("input[name='applyTime']:checked").val();
			switch (inputVlue) {
				case "1":
					vObj.search.startDate = getDate()+' 00:00:00';	
					vObj.search.endDate = getDate()+' 23:59:59';
					break;
				case "2":
					vObj.search.startDate = getMonday("s", 0)+' 00:00:00';
					vObj.search.endDate = getMonday("e", 0)+' 23:59:59';
					break;
				case "3":
					vObj.search.startDate = getMonth("s", 0)+' 00:00:00';
					vObj.search.endDate = getMonth("e", 0)+' 23:59:59';
					break;
				case "4":
					vObj.search.startDate = $("#startTime").val();
					vObj.search.endDate = $("#endTime").val();
					break;
				default:
					break;
			}
			
			vObj.getStatistics();
		},
		//获取双随机抽查结果统计
		getStatistics:function(){
			//请求等待期间显示遮罩层
			/*$('#loadingModal').modal({backdrop: 'static', keyboard: false});
			$("#loadingModal").modal('show');*/
			
			HttpUtils.POST({
				url:'/getStatistics.jspx', 
				data: vObj.search,
				success: function (response) {
					//请求成功后关闭遮罩层
					/*if(response.data.code=='10000'){
						$("#loadingModal").modal('hide');
					}*/
					//暂时删除“船员服务机构日常监督检查”项
					vObj.dataList = response.data.datas.splice(0,8);
					//console.log("data:::"+JSON.stringify(vObj.dataList));
					//vObj.dataList = response.data.datas;
				},
				error: function (error) {
				    console.log(error);	
				}
			})
		}
		
	}
});


$(function() {

	// 执行一个laydate实例
	laydate.render({
		elem : '#startTime', // 指定元素
		type:'datetime',
		format: 'yyyy-MM-dd HH:mm:ss'
	});
	// 执行一个laydate实例
	laydate.render({
		elem : '#endTime', // 指定元素
			type:'datetime',
			format: 'yyyy-MM-dd HH:mm:ss'
	});
	
});


